import React from 'react';
import ReactDOM from 'react-dom/client';
import "bootstrap/dist/css/bootstrap.min.css"
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'mobx-react';
import * as store from './store';
import { Route, Routes } from 'react-router';
import Material from './pages/material/Material';
import { BrowserRouter } from 'react-router-dom';
import MaterialList from './pages/material/MaterialList';
import MaterialEdit from './pages/material/MaterialEdit';
import Menu from './pages/menu/Menu';
import Tags from './pages/user/tag';
import Users from './pages/user/user';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <React.StrictMode>
    <BrowserRouter>
      <Provider {...store}>
        <Routes>
          <Route path='/' element={<App/>}/>
          <Route path='/menu' element={<Menu/>}/>
          <Route path='/material' element={<Material/>}/>
          <Route path='/material/list' element={<MaterialList/>}/>
          <Route path='/material/edit' element={<MaterialEdit/>}/>
          <Route path='/users/manage' element={<Users/>}/>
          <Route path='/users/tags' element={<Tags/>}/>
        </Routes>
      </Provider>
    </BrowserRouter>
  </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
